package com.cj.user.service.huawei;

import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;

/**
 * @Author cheng jun
 * @Description:相对开音节
 */
public class RelativelyOpenSyllable {

    /**
     * 反转字符串
     * @return
     */
    public static StringBuffer reverseString(String str) {
        String[] strArray = str.split("");
        //存储反转后的字符串
        StringBuffer stringBuffer = new StringBuffer();
        for (int i = strArray.length - 1; i >= 0; i--) {
            stringBuffer.append(strArray[i]);
        }
        return stringBuffer;
    }

    /**
     * 判断是否为开音节
     * @param str
     * @return
     */
    public static int judge(String str) {
        //检查该串有几个相对开音节
        int count = 0;
        String[] strArray = str.split("");
        for (int i = 0; i < strArray.length; i++) {
            if ((i + 3) < strArray.length) {
                StringBuffer stringBuffer = new StringBuffer();
                stringBuffer.append(strArray[i] + strArray[i + 1] + strArray[i + 2] + strArray[i + 3]);

                String[] strArray2 = stringBuffer.toString().split("");
                if (!strArray2[0].matches("[a, e, i, o, u]")) {
                    if (strArray2[1].matches("[a, e, i, o, u]")) {
                        if (!strArray2[2].matches("[a, e, i, o, u, r]")) {
                            if (strArray2[3].equals("e")) {
                                //该字符串为相对开音节
                                count++;
                            }
                        }
                    }
                }
            }
        }
        return count;
    }

    /**
     * 检查相对开音节个数
     * @param str
     * @return
     */
    public static int relativelyOpenSyllable(String str) {
        //存储最终的字符串
        List<String> list = new ArrayList<>();
        //存储分割后的字符串
        String[] str2 = str.split(" ");
        for (int i = 0; i < str2.length; i++) {
            //存储遍历后字符传
            String[] strArray = str2[i].split("");
            //判断是否有非字母
            boolean flag = true;
            //遍历字符串
            for (int i1 = 0; i1 < strArray.length; i1++) {
                if (!strArray[i1].matches("[a-z]")) {
                    list.add(str2[i]);
                    flag = false;
                    break;
                }
            }
            //都是字母
            if (flag) {
                list.add(reverseString(str2[i]).toString());
            }
        }

        //检查相对开音节个数
        int count = 0;
        for (String s : list) {
            count += judge(s);
        }
        return count;
    }

    public static void main(String[] args) {
        //!ekam a ekekac
        Scanner scanner = new Scanner(System.in);
        System.out.println(relativelyOpenSyllable(scanner.nextLine()));
    }
}
